<?php
/**
 * Created by PhpStorm.
 * User: leo
 * Date: 2018/5/19
 * Time: 13:17
 */
header('Content-Type:application/json');
include '../classes/logincheck.php';
include '../classes/conn.php';
$class=$_POST['class'];
if(islogin()!='stu_login') {
    die('error');
}
$query="select * from courseware where class='{$class}'";
$res=mysql_query($query);
$data=array();
while ($row=mysql_fetch_assoc($res)){
    $data[]=$row;
}
$data=json_encode($data);
echo $data;